<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ include file="/WEB-INF/jsp/include.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head><title>Persons</title></head>
  <body>
    <h1>Persons list</h1>
    <input type="button" value="Add person" onclick="location.href='<c:url value="personform.htm"/>'">
    <br><br><br>
    <table border="1" style="border-style: solid;">
    <thead style="font-style: oblique;" align="center">
    	<tr>
    		<td>ID</td>
    		<td>Surname</td>
    		<td>Name</td>
    		<td>Sex</td>
    		<td>Age</td>
    		<td>Email</td>
    		<td>Phone</td>
    		<td>Address</td>
    		<td></td><td></td>
    	</tr>
    </thead>
    <c:forEach items="${model.persons}" var="person">
     <tr>
      <td><c:out value="${person.id}"/></td>
      <td><c:out value="${person.surname}"/></td>
      <td><c:out value="${person.name}"/></td>
      <td><c:out value="${person.sex}"/></td>
      <td><c:out value="${person.age}"/></td>
      <td><c:out value="${person.email}"/></td>
      <td><c:out value="${person.phone}"/></td>
      <td><c:out value="${person.address}"/></td>
      <td><input type="button" value="Edit" onclick="location.href='<c:url value="personform.htm?id=${person.id}"/>'"></td>
      <td><input type="button" value="Delete" onclick="location.href='<c:url value="persons.htm?id=${person.id}"/>'"></td>
     </tr>
    </c:forEach>
    </table>
  </body>
</html>